import http.client,urllib

def post(url,parameters):
    params = urllib.parse.urlencode(parameters)
    headers={'Content-type':"application/x-www-form-urlencoded"}
    conn = http.client.HTTPConnection(url)
    conn.request('POST','/api',params,headers)
    response=conn.getresponse()
    return response

if __name__ == '__main__':
    print(post('www.baidu.com',{}).read())